﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Commerce/Views/Shared/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<PagedList<ICustomer>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:"Customers".Localize()%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="title">
        <%:"Customers".Localize() %></h3>
    <div class="command clearfix">
        <%: Html.ActionLink("Create new Customer".Localize(), "create", null, new { @class = "button" })%>
    </div>
    <div class="table-container">
        <table>
            <thead>
                <tr>
                    <th class="checkbox">
                        <input type="checkbox" />
                    </th>
                    <th>
                        <%:"Customer ID".Localize() %>
                    </th>
                    <th>
                        <%:"Name".Localize() %>
                    </th>
                    <th>
                        <%:"Email".Localize() %>
                    </th>
                    <th class="action">
                        <%:"View Order".Localize() %>
                    </th>
                    <th class="action">
                        <%:"Edit".Localize() %>
                    </th>
                </tr>
            </thead>
            <tbody>
                <%
                    var currentUrl = this.Request.Url.ToString();
                    foreach (var item in this.Model)
                    { %>
                <tr>
                    <td>
                        <input type="checkbox" />
                    </td>
                    <td>
                        <%: item.Id %>
                    </td>
                    <td>
                        <%: item.UserName %>
                    </td>
                    <td>
                        <%: item.MailAddress %>
                    </td>
                    <td class="action">
                        <a href="<%= Url.Action("edit", new { id = item.Id, returnUrl = currentUrl })%>#orders" class="o-icon view">
                            <%: "View orders".Localize() %></a>
                    </td>
                    <td class="action">
                        <%: Html.ActionLink("Edit".Localize(), "edit", new { id = item.Id, returnUrl = currentUrl }, new { @class = "o-icon edit" })%>
                    </td>
                </tr>
                <%}%>
            </tbody>
        </table>
        <div class="pager-wrap">
            <div class="pager">
                <%= Html.Pager(Model)%>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MenuContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="WidgetContent" runat="server">
</asp:Content>
